<template>
    <div>
        <h1>本场得分：{{ mark }}</h1> <br>
        <button @click="add">加分</button>
        <button @click="de">减分</button>
        <button @click="three">三分球</button>
        自定义得分 <input type="text" v-model.number="feng" @keyup.enter = "sun">
    </div>
</template>

<script>
    export default{
        data(){
            return {
                mark:0,
                feng:0
            }
        },
        methods:{
            add(){
                this.mark ++
            },
            de(){
                this.mark --
            },
            three(){
                if(this.mark >0){
                    this.mark += 3
                }
                
            },

            sun(){
                this.mark = this.feng
            }
        },
    }
</script>

<style>

</style>